import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '工艺名称',
    align:"center",
    dataIndex: 'craftName_dictText'
   },
   {
    title: '溶剂名称',
    align:"center",
    dataIndex: 'solventName'
   },
   {
    title: '溶剂批次',
    align:"center",
    dataIndex: 'solventBatch'
   },
   {
    title: '溶剂类型',
    align:"center",
    dataIndex: 'solventType'
   },
  //  {
  //   title: '气体密度上限（ kg/m3 ）',
  //   align:"center",
  //   dataIndex: 'concentrationUp'
  //  },
  //  {
  //   title: '气体密度下限（ kg/m3 ）',
  //   align:"center",
  //   dataIndex: 'concentrationDown'
  //  },
   {
    title: '溶剂产品比',
    align:"center",
    dataIndex: 'productSolventRatio'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
	{
      label: "工艺名称",
      field: 'craftName',
      component: 'JSearchSelect',
      componentProps:{
         dict:"camellia_mes_process_craft,craft_name,id"
      },
      colProps: {span: 6},
 	},
	{
      label: "溶剂名称",
      field: 'solventName',
      component: 'Input',
      colProps: {span: 6},
 	},
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '工艺名称',
    field: 'craftName',
    component: 'JSearchSelect',
    componentProps:{
       dict:"camellia_mes_process_craft,craft_name,id"
    },
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入工艺名称!'},
          ];
     },
  },
  {
    label: '溶剂名称',
    field: 'solventName',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入溶剂名称!'},
          ];
     },
  },
  {
    label: '溶剂批次',
    field: 'solventBatch',
    component: 'Input',
  },
  {
    label: '溶剂类型',
    field: 'solventType',
    component: 'Input',
  },
  // {
  //   label: '气体密度上限（ kg/m3）',
  //   field: 'concentrationUp',
  //   component: 'InputNumber',
  // },
  // {
  //   label: '气体密度下限（ kg/m3 ）',
  //   field: 'concentrationDown',
  //   component: 'InputNumber',
  // },
  {
    label: '溶剂产品比',
    field: 'productSolventRatio',
    component: 'InputNumber',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];



/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}